Skip to content

Get other.Rraw running again in r-devel#7833

Open
MichaelChirico wants to merge 8 commits into
masterfrom
other-attach-order
Open

Get other.Rraw running again in r-devel#7833
MichaelChirico wants to merge 8 commits into
masterfrom
other-attach-order

Conversation

@MichaelChirico

@MichaelChirico MichaelChirico commented Jul 23, 2026

Copy link
Copy Markdown
Member

A few changes here:

  • We need to mess with the attach order. Originally tried attach.required=FALSE but that's not present on R 3.5.0.
  • {ggplot2} internals have moved around again. I think the intent of those tests is just to ensure print(<ggplot-obj>) works without error, so I refactored the tests to do that more directly.
  • A legit bugfix for example() (described below).
  • Robustness improvement for a {bit64} test when lacking proper long double. I'm of half a mind to just delete that test because it's only testing {bit64} functionality anyway...
  • Since RFC: fail test.data.table() if non-test code produces warnings #7210, warning() outside of test() is caught, so change an intentional warning on Windows to cat().

Without the update to cedta() we get the telltale cedta() issues from here:

# example(":=", local=TRUE) triggered cedta==FALSE and then error, #2972
test(14.1, {example(':=', package='data.table', local=TRUE, echo=FALSE); TRUE})
test(14.2, {example('CJ', package='data.table', local=TRUE, echo=FALSE); TRUE})

Expected: 
Observed: [ was called on a data.table in an environment that is not data.table-aware (i.e. cedta()), but ':=' was used, implying the owner of this call really intended for data.table methods to be called. See vignette('datatable-importing') for details on properly importing data.table.
Test 14.2 produced 1 errors but expected 0
Expected: 
Observed: could not find function "J"

AIUI this is because of #7162 adding one more item on the call stack during execution of example().

Split off from #7832 as the actual debugging of package code should be done artisinally.

@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.01%. Comparing base (46d0934) to head (20963c5).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7833   +/-   ##
=======================================
  Coverage   99.01%   99.01%           
=======================================
  Files          88       88           
  Lines       17234    17234           
=======================================
  Hits        17065    17065           
  Misses        169      169           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown
  • HEAD=other-attach-order much faster for DT[by,verbose=TRUE] improved in #6296
    Comparison Plot

Generated via commit 20963c5

Download link for the artifact containing the test results: ↓ atime-results.zip

Task Duration
R setup and installing dependencies 2 minutes and 16 seconds
Installing different package versions 33 seconds
Running and plotting the test cases 5 minutes and 57 seconds

@MichaelChirico MichaelChirico changed the title Use attach.required=FALSE to solve "ggplot not found" error in other.Rraw Fix attach order for other.Rraw Jul 23, 2026
@MichaelChirico MichaelChirico changed the title Fix attach order for other.Rraw Get other.Rraw running again in r-devel Jul 23, 2026
Comment thread inst/tests/other.Rraw
@@ -1,9 +1,9 @@
pkgs = c("DBI", "RSQLite", "bit64", "caret", "dplyr", "gdata", "ggplot2", "hexbin", "knitr", "nanotime", "nlme", "parallel", "plyr", "R.utils", "sf", "vctrs", "xts", "yaml", "zoo")
pkgs = c("DBI", "RSQLite", "bit64", "ggplot2", "caret", "dplyr", "gdata", "hexbin", "knitr", "nanotime", "nlme", "parallel", "plyr", "R.utils", "sf", "vctrs", "zoo", "xts", "yaml")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we maybe add a comment above why we enforce this ordering? seems out of the blue without reading later comment

Comment thread inst/tests/other.Rraw
DT = data.table( a=1:5, b=11:50, d=c("A","B","C","D"), f=1:5, grp=1:5 )
test(1.1, names(print(ggplot(DT,aes(b,f))+geom_point()))[c(1,3)], c("data","scales")) # update as described in #3047
test(1.2, DT[,print(ggplot(.SD,aes(b,f))+geom_point()),by=list(grp%%2L)],data.table(grp=integer())) # %%2 to reduce time needed for ggplot2 to plot
print_without_error = function(x) !inherits(tryCatch(print(x), error=identity), "error")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need this here? Previously we/you have used the test(, {print(DT); TRUE}) idiom e.g. in test 2187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants